<template>
  <el-dialog
    v-dialogDrag
    :title="title"
    :visible.sync="visible"
    width="60%"
    append-to-body
    :close-on-click-modal="false"
    @close="hide"
  >
    <div class="dialog_content adjust-box">
      <el-collapse v-model="activeNames" @change="handleChange">
        <el-collapse-item name="1">
          <template slot="title">
            <div class="head-title">
              节点信息
            </div>
          </template>
          <el-table
            :data="tableData"
            style="width: 100%"
          >
            <el-table-column
              prop="name"
              label="节点名称"
            />
            <el-table-column
              prop="date"
              label="入参"
            />
            <el-table-column
              prop="date"
              label="出参"
            />
            <el-table-column
              prop="address"
              label="context"
            />
            <el-table-column
              prop="address"
              label="事务状态"
            />
          </el-table>
        </el-collapse-item>
        <el-collapse-item name="2">
          <template slot="title">
            <div class="head-title">
              执行的sql信息
            </div>
          </template>
          <code>select * from user;select date from user;</code>
        </el-collapse-item>
        <el-collapse-item name="3">
          <template slot="title">
            <div class="head-title">
              堆栈信息
            </div>
          </template>
          <div>简化流程：设计简洁直观的操作流程；</div>
          <div>清晰明确：语言表达清晰且表意明确，让用户快速理解进而作出决策；</div>
          <div>帮助用户识别：界面简单直白，让用户快速识别而非回忆，减少用户记忆负担。</div>
        </el-collapse-item>
      </el-collapse>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button @click="cancel">
        关 闭
      </el-button>
    </div>
  </el-dialog>
</template>

<script>

export default {
  data() {
    return {
      loading: {
        confirm: false,
      },
      visible: false,
      activeNames: ['1'],
      tableData: [{
        date: '{date:2016-05-02}',
        name: '算法节点',
        address: 'good',
      }],
    };
  },
  computed: {
    title() {
      return '日志详情';
    },
  },
  mounted() {},
  created() {},
  methods: {
    handleChange(val) {
      console.log(val);
    },
    cancel() {
      this.hide();
    },
    show(data) {
      console.log('data', data);
      this.visible = true;
    },
    hide() {
      this.visible = false;
    },
  },
};
</script>
<style lang="scss" scoped>
.adjust-box ::v-deep {
  .el-textarea .el-input__count {
    color: #909399;
    background: #fff;
    position: absolute;
    font-size: 12px;
    bottom: 2px;
    right: 10px;
  }
  .el-form-item {
    margin-bottom: 20px;
  }
}
.head-title{
    border-left: solid 4px #31d0c6;
    padding-left: 10px;
    color: #333;
    font-weight: bold;
}
code {
    background: #333;
    color: #ebe0e0;
    padding: 12px;
    width: 100%;
    max-height: 100px;
    min-height: 50px;
    display: block;
    overflow-y: auto;
}
</style>
